package com.chixing.day13_list;

import java.util.ArrayList;
import java.util.Iterator;

public class ListDemo {
    public static void main(String[] args) {
        ArrayList<String> list = new ArrayList<>();


        //遍历
        Iterator<String> it = list.iterator();
        while (it.hasNext()){
            String ele = it.next();
            System.out.println(ele);
        }


        //foreach : 底层也是迭代器 Iterator ，以上的语法简化

    }
}
